﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using com.IronOne.BoardPACWinAppBO.Meeting;
using com.IronOne.BoardPACWinAppDAO.Meeting;
using com.IronOne.BoardPACWinAppUtil.Enums;

namespace com.IronOne.BoardPACWinAppService.Meeting
{
    public class MeetingService : IMeetingService
    {
        private readonly IMeetingDAO _meetingDAO;

        public MeetingService()
        {
            _meetingDAO = new MeetingDAO();
        }

        public async Task<List<MeetingModel>> GetMeetings(int categoryId, int subCategoryId)
        {
            try
            {
                return await _meetingDAO.GetMeetings(categoryId, subCategoryId);
            }
            catch (Exception)
            {
                throw;
            }
        }

        public async Task<MeetingModel> GetMeetingById(int meetingId)
        {
            try
            {
                return await _meetingDAO.GetMeetingById(meetingId);
            }
            catch (Exception)
            {
                throw;
            }
        }

        public async Task<List<DateTime>> GetMeetingsByMonth(MonthSelection monthSelection)
        {
            try
            {
                return await _meetingDAO.GetMeetingsByMonth(monthSelection);
            }
            catch (Exception)
            {
                throw;
            }
        }

        public async Task<bool> AddMeetingNote(int memberId, int meetingId, string meetingNote)
        {
            try
            {
                return await _meetingDAO.AddMeetingNote(memberId, meetingId, meetingNote);
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
}